package project;

public class ShoppingItem
{
  Product product;
  double amount;

  public ShoppingItem(Product product)
  {
    this.product = product;
    this.amount = 1.0D;
  }

  public ShoppingItem(Product product, double amount) {
    this.product = product;
    this.amount = amount;
  }

  public double getAmount()
  {
    return this.amount;
  }

  public void setAmount(double amount)
  {
    this.amount = amount;
  }

  public Product getProduct()
  {
    return this.product;
  }

  public void setProduct(Product product)
  {
    this.product = product;
  }

  public double getTotal()
  {
    return this.amount * this.product.getPrice();
  }
}